﻿@model BlogLite.Areas.Admin.Models.PostViewModel

@{
    ViewBag.Title = "Edit Post";
    Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml";
}

@section ContentHead {   
    <link href="@Url.Content("~/Content/jHtmlArea.css")" rel="Stylesheet" type="text/css" />   
    <link href="@Url.Content("~/Content/jHtmlArea.ColorPickerMenu.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/overcast/jquery-ui-1.8.11.custom.css")" rel="stylesheet" type="text/css" />       
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.custom.min.js")" type="text/javascript" ></script>  
    <script src="@Url.Content("~/Scripts/jHtmlArea-0.7.0.min.js")" type="text/javascript" ></script>     
    <script src="@Url.Content("~/Scripts/jHtmlArea.ColorPickerMenu-0.7.0.min.js")" type="text/javascript" ></script> 
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
	<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>    
	
     <style type="text/css">       
        div.jHtmlArea > div > iframe  
        {
            border-top: 2px solid #C9C9C9;
            border-left: 2px solid #C9C9C9;
            height: 100%;
            overflow: hidden;
        }
    </style>

    @*Trick to get VS to pickup jQuery IntelliSense*@
    @if (false)
    {         
        <script type="text/javascript" src="../../../../Scripts/jquery-1.4.1.min.js"></script> 
    }
}

<script type="text/javascript">
    $(function () {
        $('textarea').htmlarea({
            toolbar: [
                ["html"],
                ["bold", "italic", "underline", "strikethrough", "|", "forecolor"],
                ["superscript", "subscript"],
                ["increasefontsize", "decreasefontsize"],
                ["orderedlist", "unorderedlist"],
                ["indent", "outdent"],
                ["justifyleft", "justifycenter", "justifyright"],
                ["link", "unlink", "horizontalrule"],
                ["p", "h1", "h2", "h3", "h4", "h5", "h6"],
                ["cut", "copy", "paste"]
            ]
        });
        $('#postDate').datepicker();
    });
</script>

<div class="left" id="content_outer">
	<div id="content"> 
        @{ Html.EnableClientValidation(); }     
        @using (Html.BeginForm())
        {
            <h2>Edit Post</h2>		
            @:Post Title
            <br />
            @Html.TextBoxFor(m => Model.Post.Subject, new { style="width: 550px;" })<br />
            @Html.ValidationMessageFor(m => Model.Post.Subject)
            <br /><br />
            @:Post Content
            <br />            
            @Html.TextAreaFor(m => Model.Post.Content, new { cols = "75", rows = "15", })
            @Html.ValidationMessageFor(m => Model.Post.Content)
            <br /><br />         
            @:Post Date
            <br />            
            @Html.TextBoxFor(m => Model.Post.PostDate, new { id = "postDate", Value = String.Format("{0:MM/dd/yyyy}", Model.Post.PostDate), @readonly = "readonly", style = "width: 75px;" })
            @Html.ValidationMessageFor(m => Model.Post.PostDate)
            <br /><br />
            @:Tags
            <br />
            @Html.ListBoxFor(m => Model.SelectedTags, Model.Tags, new { style = "width: 300px;" })
            <br /><br />            
            @:New Tags (comma delimited list)
            <br />
            @Html.TextBoxFor(m => Model.NewTags, new { style = "width: 550px;;" })            
            <br /><br />     
            @Html.AntiForgeryToken()   
            @Html.HiddenFor(m => Model.Post.PostId, new { value = Model.Post.PostId });
            <input type="submit" value="Save Edits" />
        }        
	</div>
</div>

<div class="clearer">&nbsp;</div>